package com.franzliszt.OrderOnline.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.franzliszt.OrderOnline.tool.Goods;
import com.franzliszt.hospitalnumberingsystem.R;


import java.util.List;

public class contentAdapter extends BaseQuickAdapter<Goods.GoodsContent, BaseViewHolder> {


    public contentAdapter(int layoutResId, @Nullable List<Goods.GoodsContent> data) {
        super( layoutResId, data );
    }

    public contentAdapter(@Nullable List<Goods.GoodsContent> data) {
        super( data );
    }

    public contentAdapter(int layoutResId) {
        super( layoutResId );
    }

    @Override
    protected void convert(BaseViewHolder helper, Goods.GoodsContent item) {
        helper.setText( R.id.medicineName,item.getContent() );
        helper.setText( R.id.medicineSpecs,item.getSpecs() );
        helper.setText( R.id.medicinePrice,item.getPrice()+"" );
        helper.setText( R.id.Number,item.getNumber()+"" );
        helper.setImageResource( R.id.medicineIMG,item.getGoodsIMG() );
        helper.setImageResource( R.id.Add,item.getAddIMG() );
        helper.setImageResource( R.id.Sub,item.getSubIMG() );
        helper.addOnClickListener( R.id.Add );
        helper.addOnClickListener( R.id.Sub );
    }
}
